package init

import (
	"github.com/spf13/viper"
	"log"
	"srv/basic/config"
)

func InitConfig() {
	viper.SetConfigFile("../../dev.yaml")
	err := viper.ReadInConfig()
	if err != nil {
		panic(err)
	}
	err = viper.Unmarshal(&config.Config)
	if err != nil {
		panic(111)
	}
	log.Println("动态读取配置成功", config.Config)
}
